﻿Imports System
Imports System.IO
Imports System.Data
Imports System.Data.SqlServerCe
Imports System.Drawing
Imports System.Collections
Imports System.Windows.Forms
Imports System.Data.Common

Module UserDao

    Public Function findUsers(ByVal userName As String, ByVal userPassword As String) As DataTable
        Dim dtResult As New DataTable
        Dim paramList As New Hashtable()

        Dim SQL As String = "SELECT u.USER_ID, u.USER_NAME, u.USER_FULL_NAME, u.USER_ROLE, welder.WELDER_NAME " & _
                  " , welder.WELDER_ID, welder.WELDER_COMPANY_CODE, welder.WELDER_COMPANY_NAME" & _
                  " FROM eqam_user u LEFT JOIN eqam_welder welder ON u.USER_ID = welder.WELDER_ID WHERE u.USER_NAME = @username AND u.USER_PASSWORD = @userpassword"

        paramList.Add("@username", userName)
        paramList.Add("@userpassword", userPassword)

        Return LoadData(SQL, paramList)
    End Function
End Module
